using array_demo.Model;
using Xunit;

namespace ArrayTest
{
    public class UnitTest1
    {
        public Array1<int> array = new Array1<int>();
        public LinkedList1<int> linkedList = new LinkedList1<int>();

        public UnitTest1()
        {
            for (int i = 0; i < 7; i++)
            {
                array.Add(i, i);
            }
        }


        [Fact]
        public void AddTest()
        {
            array.AddLast(12);
            Assert.True(array.Count == 8, "");
        }


        [Fact]
        public void UpdateTest()
        {
            array.Update(1, 3);
            Assert.True(array.GetByIndex(1) == 3, "");
        }


        [Fact]
        public void getLinkedByIndexTest()
        {
            for (int i = 0; i < 10; i++)
            {
                linkedList.AddNode(i, i);
            }
            int num = linkedList.GetLast();
            Assert.True(num == 9, "");
        }

    }
}